Skip to content

Conversation

@sandrafox
Copy link

No description provided.

@vercel
Copy link

vercel bot commented Sep 13, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://task5.itmo-yandex.now.sh

@@ -0,0 +1,33 @@
import React, { Component } from 'react';

import './app.css';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import imageUrl from './image.png';

<div className="option options__createdir">Создать папку</div>
</div>
</div>
<Main inputActive={this.state.inputActive} onClickLetter={() => this.clickHandlerLetter()} />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Будет всегда перерендериваться


// надо впихивать письма в конец, потом при рендере откусить последние 30 элементов и выводить с последнего
render() {
if (this.props.inputActive || this.state.view === -1) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { inputActive } = this.props;
const { view } = this.state;

},
{ from: 'ЯндексПаспорт', theme: 'Доступ к аккаунту', date: '5 авг', text: 'Доступ' }
],
view: -1,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не хватает семантики

// надо впихивать письма в конец, потом при рендере откусить последние 30 элементов и выводить с последнего
render() {
if (this.props.inputActive || this.state.view === -1) {
if (this.state.view !== -1) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В render не должно быть side-эффектов, он должен только отдавать вёрстку

class FullLetter extends Component {
render() {
return(
<div>{this.props.text}</div>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Приделать кнопочку)

};

renderLetter = (letter, i) => {
if (i < 30) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше не использовать магические числа в коде

if (this.state.view !== -1) {
this.setState({ ...this.state, view: -1 });
}
return <div className="letters">{this.state.letters.map(this.renderLetter)}</div>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slice()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants